<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8" />
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="http://tv.speechb.com/lib/superui/content/ui/global/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link href="http://tv.speechb.com/lib/superui/content/ui/global/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <!-- Theme style -->
    <link rel="stylesheet" href="http://tv.speechb.com/lib/superui/content/adminlte/dist/css/AdminLTE.css">
    <link rel="stylesheet" href="http://tv.speechb.com/lib/content/adminlte/dist/css/skins/_all-skins.min.css">
    <link href="http://tv.speechb.com/lib/superui/content/min/css/supershopui.common.min.css" rel="stylesheet" />
    <link href="http://tv.speechb.com/lib/superui/content/plugins/bootstrap-table/bootstrap-table.css" rel="stylesheet" />
    <link href="http://tv.speechb.com/lib/superui/content/layx/layx.min.css" rel="stylesheet" />
    <link href="http://tv.speechb.com/lib/x-editable/css/select2-bootstrap.css" rel="stylesheet"/>
    <link href="http://tv.speechb.com/lib/select2/css/select2.min.css" rel="stylesheet"/>
    <!--全局通用框架样式 end-->
</head>
<body>
<!--
<script id="editor" type="text/plain" style="height: 150px;"/>
-->
<!-- Main content -->
    <div class="content">
        <div class="box box-info">
            <h4 class="box-header with-border" >添加菜单</h4>
        </div>
        <div class="form-horizontal content" style="margin-top: 10px;max-width: 640px">
            <div class="box-body" style="max-width: 640px">
                <div class="form-group">
                    <label for="title" class="col-sm-2 control-label">标题</label>
                    <div class="col-sm-10">
                        <input id="title" type="text" class="form-control" placeholder="请输入标题">
                    </div>
                </div>
                <div class="form-group">
                    <label for="summary" class="col-sm-2 control-label">概要</label>
                    <div class="col-sm-10">
                        <input id="summary" type="text" class="form-control" placeholder="请输入概要">
                    </div>
                </div>
                <div class="form-group">
                    <label for="temp_url" class="col-sm-2 control-label">URL</label>
                    <div class="col-sm-10">
                        <input id="temp_url" type="text" class="form-control" placeholder="请输入表白模板URL">
                    </div>
                </div>
                <div class="form-group">
                    <label for="img_url" class="col-sm-2 control-label">图片链接</label>
                    <div class="col-sm-10">
                        <input id="img_url" type="text" class="form-control" placeholder="请输入图片链接">
                    </div>
                </div>
            </div>
        </div>
    </div>

<button id="submitBtn" type="button" class="btn btn-primary center-block" style="margin-top:10px"> 添加表白情书</button>

<script src="http://tv.speechb.com/lib/superui/content/ui/global/jQuery/jquery.min.js"></script>

<!-- Bootstrap 3.3.6 -->
<script src="http://tv.speechb.com/lib/superui/content/ui/global/bootstrap/js/bootstrap.min.js"></script>
<script src="http://tv.speechb.com/lib/select2/js/select2.full.min.js"></script>
<script src="http://tv.speechb.com/lib/superui/content/min/js/supershopui.common.js"></script>
<!--富文本框-->
<script type="text/javascript" charset="utf-8" src="http://tv.speechb.com/lib/toaster/jquery.toaster.js"></script>

<script type="text/javascript">
    $(function () {
        $("#submitBtn").click(function () {
            var summary = $("#summary").val();
            var title = $("#title").val();
            var imgUrl = $("#img_url").val();
            var tempUrl = $("#temp_url").val();
            $.ajax({
                type: "POST",
                url: "/admin/expression_templates/add",
                data: {
                    "summary": summary,
                    "title": title,
                    "img_url": imgUrl,
                    "temp_url": tempUrl
                },
                success: function (result) {
                    if (result.code == 1) {
                        $("#menu").val("");
                        $.toaster({priority: "success", title: "通知", message: "发布成功"});
                    } else {
                        $.toaster({priority: "danger", title: "通知", message: "发布失败"})
                    }
                },
                error: function (e) {
                    $.toaster({priority: "danger", title: "通知", message: "发布失败"})
                }
            });
        });
    });

</script>
</body>

</html>